
package com.zxg.zbc.web.home.module.screen;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.service.requestcontext.parser.ParameterParser;
import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.zxg.zbc.biz.exception.ManagerException;
import com.zxg.zbc.dal.dataobject.EUserShop;
import com.zxg.zbc.dal.dataobject.User;
import com.zxg.zbc.web.common.module.BaseUserModule;

/**
 * 切换店铺
 * @author hangding
 */
public class SwitchShop extends BaseUserModule{
  final static Logger log = LoggerFactory.getLogger(SwitchShop.class);
  @Autowired
  HttpServletRequest  request;
  @Autowired
  HttpServletResponse response;
	@Override
	public void doExecute(Context context, ParameterParser params, Navigator nav,
			User loginUser) {
		Long shopId = params.getLong("id");
		
		try {
			EUserShop shop = userManager.getElemeShopByLocalId(shopId,loginUser);
			if(shop!=null){
				permissionShop(shop);
			}
		} catch (ManagerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
@Override
	protected boolean skipPermission() {
		return false;
	}
  

}
